package es.ucm.fdi.bdt.gui;

import java.awt.BorderLayout;
import java.awt.EventQueue;
import java.awt.Font;

import javax.swing.DefaultListCellRenderer;
import javax.swing.DefaultListModel;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.SwingConstants;

import net.miginfocom.swing.MigLayout;

import javax.swing.JList;
import javax.swing.border.BevelBorder;
import javax.swing.border.LineBorder;

import java.awt.Color;
import java.awt.GridLayout;

import javax.swing.UIManager;
import javax.swing.border.MatteBorder;
import javax.swing.JTextPane;

import java.awt.SystemColor;

import javax.swing.JTextArea;
import javax.swing.JScrollPane;

@SuppressWarnings("serial")
public class GUIServicios extends GUIInicio {

	private JPanel contentPane;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					new GUIServicios();
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public GUIServicios() {
		setTitle("Servicios");
		JPanel panel = new JPanel();
		getContentPane().add(panel, BorderLayout.CENTER);
		panel.setLayout(new BorderLayout(0, 0));
		
		JPanel panel_1 = new JPanel();
		panel.add(panel_1);
		panel_1.setLayout(new BorderLayout(0, 0));
		
		JPanel panel_2 = new JPanel();
		panel_1.add(panel_2, BorderLayout.NORTH);
		panel_2.setLayout(new MigLayout("", "[94px]", "[24px]"));
		
		JLabel lblServicios = new JLabel("Servicios");
		panel_2.add(lblServicios, "cell 0 0,alignx left,aligny top");
		lblServicios.setHorizontalAlignment(SwingConstants.LEFT);
		lblServicios.setVerticalAlignment(SwingConstants.TOP);
		lblServicios.setFont(new Font("Arial", Font.BOLD, 20));
		
		JPanel panel_3 = new JPanel();
		panel_1.add(panel_3, BorderLayout.CENTER);
		panel_3.setLayout(new GridLayout(0, 2, 0, 0));
		
		JPanel panel_4 = new JPanel();
		panel_4.setBackground(UIManager.getColor("Button.background"));
		panel_3.add(panel_4);
		
		DefaultListModel<String> modeloLista = new DefaultListModel<String>();
		panel_4.setLayout(new BorderLayout(0, 0));
		JList<String> list = new JList<String>();
		list.setBackground(SystemColor.menu);
		DefaultListCellRenderer cellRenderer = (DefaultListCellRenderer) list.getCellRenderer();
		cellRenderer.setHorizontalAlignment(SwingConstants .CENTER);
		list.setModel(modeloLista);
		panel_4.add(list, BorderLayout.CENTER);
		modeloLista.addElement("Servicio 1");
		modeloLista.addElement("Servicio 2");
		modeloLista.addElement("Servicio 3");
		modeloLista.addElement("Servicio 4");
		modeloLista.addElement("Servicio 5");
		modeloLista.addElement("Servicio 6");
		
		JPanel panel_5 = new JPanel();
		panel_5.setBorder(new MatteBorder(0, 1, 0, 0, (Color) new Color(0, 0, 0)));
		panel_3.add(panel_5);
		panel_5.setLayout(new BorderLayout(0, 0));
		
		JTextArea textArea = new JTextArea();
		textArea.setWrapStyleWord(true);
		textArea.setEditable(false);
		textArea.setLineWrap(true);
		textArea.setBackground(SystemColor.menu);
		textArea.setText("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur eleifend sit amet mauris at sagittis. Cras aliquet pretium justo, sed viverra arcu bibendum a. Pellentesque at luctus felis. Sed dapibus vestibulum nisi quis sagittis. Suspendisse eget venenatis ipsum. In lacus dolor, malesuada a egestas sit amet, luctus eu ligula. Integer. ");
		
		JScrollPane scrollPane = new JScrollPane(textArea);
		panel_5.add(scrollPane);
		//panel_5.add(textArea);
		
	}

}
